package no.sachmuld.methodcombination.impl.validate;

import no.sachmuld.methodcombination.api.BehaviourMethod;

/**
 *
 */
public class IncompatibleExceptionTypes extends MethodCombinationValidationError {

    private BehaviourMethod behaviourMethod;

    public IncompatibleExceptionTypes(Class targetClass, BehaviourMethod behaviourMethod) {
        super(targetClass);
        this.behaviourMethod = behaviourMethod;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("Incompatible exception types in method ");
        sb.append(behaviourMethod.getMethodName());
        sb.append(" in behaviour class ");
        sb.append(behaviourMethod.getBehaviourClass().getName());
        return sb.toString();
    }
}
